<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" import="java.util.*,com.epam.tcs.actions.*,com.epam.tcs.dao.hibernate.entities.*"%>
<%@ include file="../template/header.jsp" %>
<%@ include file="../template/left_menu_alt.jsp" %>
<div id="content">
	<div id="breadcrumbs">
		<c:if test="${requestScope.breadcrumbs != null}">
			<c:set var="i" value="0"/>
			<c:forEach items="${requestScope.breadcrumbs}" var="bc">
				<a href="${pageContext.request.contextPath}${bc.getUrl()}">${bc.getCaption()}</a>		
			</c:forEach>
		</c:if>
	</div>
	<span style="color: green;">
		${requestScope.message}
	</span>
<form method="post" action="${pageContext.request.contextPath}${requestScope.action}" id="theme_form">
	<table>
			<tr>
				<td>Название</td>
				<td><input type="text" name="caption"/></td>
			</tr>
			<tr>
				<td>Кол-во часов</td>
				<td><input type="text" name="hours"/></td>
			</tr>
			<tr>
				<td>Описание</td>
				<td><input type="text" name="description"/></td>
			</tr>			
	</table>
</form>
</div>
<script type="text/javascript">
$(function() {
	$( "#back_to_theme" ).bind('click', function(){
		window.location = "${pageContext.request.contextPath}/tcs/theme";
	});	
	$( "#reset_form_theme" ).bind('click', function(){
		resetForm($("#theme_form"));
	});
	$( "#send_form_theme" ).bind('click', function(){
		sendThemeForm();
	});
});

function sendThemeForm(){
	$("#theme_form").submit();
}

function resetForm($form) {
    $form.find('input:text, input:password, input:file, select, textarea').val('');
    $form.find('input:radio, input:checkbox').removeAttr('checked').removeAttr('selected');
}
	

</script>

<%@ include file="../template/footer.jsp" %>